//海南麻将
module.exports.createRoom = function(roomId,channelService,GameRemote) {
	console.log("new!!55555创建房间:"+roomId)
	var gameBasic = require("./basic/gameBasic.js")
	var logicBasic = require("./logic/mahjongLogic.js")
	var logic = new logicBasic()
	var local = {}
	var playerNum = 4
	var room = new gameBasic(roomId,"hnMahjong",playerNum,channelService,GameRemote)
	var handCardList = []
	room.playTimer = 0 				//出牌定时器
	local.PLAY_TIME = 20000 		//出牌时间
	local.curPlayer = -1 			//当前玩家
	//游戏开始
	room.gameBegin = function() {
		handCardList = logic.sendCard()
		local.curPlayer = Math.floor(Math.random() * playerNum)
		for(var i = 0;i < room.players.length;i++){
			if(room.players[i].isActive){
				var notify = {
					cmd : "gameBegin",
					handCard : handCardList[i],
					curPlayer : local.curPlayer,
					chair : i
				}
				room.sendByUid(room.players[i].uid,notify)
			}
		}
	}
	//获取当前房间信息
	room.handle.getRoomInfo = function(uid,sid,param,cb) {
		var chair = room.chairMap[uid]
		var info = {
		}
		cb(true,info)
	}
}